package com.xms.sdk.core.query;

/**
 * <p>
 * AggregateType
 * </p>
 *
 * @author migo
 * @since 2021/9/7
 */
public enum AggregateType {
    None(-1, "none"),
    Count(0, "count"),
    Sum(1, "sum"),
    Avg(2, "avg"),
    Max(3, "max"),
    Min(4, "min");

    AggregateType(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public boolean equals(AggregateType compared){
        return this.value() == compared.value();
    }

    public int value() {
        return value;
    }

    public String text() {
        return name;
    }

    private int value;
    private String name;
}
